package com.hw.paltfrom.controller.supervisor;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hw.paltfrom.pack.ResponseResult;
import com.hw.paltfrom.rescode.HWSystemCode;
import com.hw.paltfrom.service.supervisor.SupervisoryBackServer;
import com.hw.paltfrom.utils.VerifyUtil;
import com.hw.paltfrom.vo.CountryCasemainVo;
import com.hw.paltfrom.vo.SupervisionVo;

@RestController
@RequestMapping(value = "/SupervisoryBack")
public class SupervisoryBackController {

	@Autowired
	private SupervisoryBackServer supervisoryBackServer;

	// 查询
	@RequestMapping(value = "/query")
	public Map<String, Object> query(SupervisionVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return supervisoryBackServer.query(vo);
	}

	// 反馈
	@RequestMapping(value = "/feedback")
	public Map<String, Object> feedback(@RequestBody SupervisionVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return supervisoryBackServer.feedback(vo);
	}

	// 详情
	@RequestMapping(value = "/queryDetails")
	public Map<String, Object> queryDetails(SupervisionVo vo) {

		return supervisoryBackServer.queryDetails(vo.getfSpvid());
	}
}
